package com.kuang.dao;


import com.kuang.pojo.Department;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

@Repository
public class DepartmentDao {
    private static Map<Integer,Department> maps;
    static {
        maps=new HashMap<>();
        maps.put(101,new Department(101,"教研1"));
        maps.put(102,new Department(102,"教研2"));
        maps.put(103,new Department(103,"教研3"));
        maps.put(104,new Department(104,"教研4"));
        maps.put(105,new Department(105,"教研5"));
    }
    public Department getDepartmentId(Integer id){
        return maps.get(id);
    }
    public Collection<Department> getDepartments(){
        return maps.values();
    }
}
